The present invention relates to a parallel database record distribution method and a parallel database management system, or more particular to a record distribution method and a management system capable of managing the addition of a database unit in a parallel database management system including a plurality of database units in versatile way.
Conventionally, when a large amount of records are to be distributed equally among a plurality of database units of a parallel database management system, a hash function is used in view of a high level of versatility against the increase in the number of records with a small overhead for distribution. In such a case, the hash function is used for both the preparation and addition of a record and the search of the record. In other words, when a new record which has been prepared is stored in a parallel database, the hash function is used to determine a database unit to store it in, and when searching for the desired record, the same hash function is used to determine the database unit having the record stored therein.
The hash function is used in the systems described in JP-A-2-113349, JP-A-4-160475 and JP-A-6-103127, for example.
As described above, the use of the hash function for both the preparation/addition of a record and the record search poses the following problems:
(1) The hash function and the result of the hashing (calculation using the hash function) depend on the actual number of divisions (the number of database units) for the parallel database management system. Therefore, when a database unit is added in the parallel database management system, i.e., when the number of divisions is changed, it is necessary to redistribute the entire record stored so far among the database units using the new hash function depending on the changed number of divisions. This imposes a great burden and makes an efficient operation of the parallel database impossible.
(2) Even when a database unit is added without redistributing (restoring) the record, the record is not stored in the newly-added database unit, and it is impossible to distribute the record equally among the database units.
The present invention has been developed to solve the above-mentioned problem points, and the object of the present invention is to provide a record distribution method and a management system capable of meeting a change in the number of database divisions in a versatile manner in a parallel database management system for managing a database divided among a plurality of database units.
The above-mentioned object of the invention is achieved by changing the hash function used for storing a record when a database unit is added in a parallel database management system for managing a database divided among a plurality of database units.
Also, the above-mentioned object of the invention is achieved by a parallel database management system for managing a database divided among a plurality of database units, in which the hash function is used for storing a record and the record is searched/updated without using the hash function.
Further, the above-mentioned object of the present invention is achieved by a parallel database management system for managing a database divided among a plurality of database units, in which a record is stored in an added database unit in a greater proportion than in other database data units for a predetermined length of time.
The above-mentioned object may be achieved by a parallel database management system comprising the function of registering the configuration of an external memory unit for storing a database in divided portions and referencing and altering the contents of the registered configuration, the function of uniquely determining an external memory unit for storing a record from among the external memory units registered in the database configuration information register using the hash function as a record value, the function of storing and adding a record in an arbitrary external memory unit constituting the database, and the function of searching for and updating a record in an arbitrary external memory unit constituting the database. At the time of preparing and adding a record, the storage position determining function and the record storage and addition function are used to store and add the record, so that all of the external memory units constituting the database are searched concurrently using the record search and update function without using the storage position determining function at the time of record search and update, and at the time of changing the number of divisions of the database as when a CPU is added, the data are stored mainly in an arbitrary added external memory unit.
Also, the above-mentioned object is achieved by a parallel database management system having the function of storing the average record increase per unit time in the database and storing the number of records in the external memory units, and the function of storing the records in an added external memory unit by altering the hash function only during the time proportional to the number of records in the external memory units divided by the average amount of increase in the records when altering the number of database divisions, and the function of securing, during the subsequent record addition, equal storage of the records that have been found unequal at the time of altering the number of database divisions.
Further, the above-mentioned object of the invention can be achieved by a parallel database management system having the function of storing the number of records stored in each of the external memory units and the function of moving records to a newly added external memory unit in a CPU from each of the existing external memory units by the number of records in the existing external memory units before altering the number of database divisions, divided by an altered number of database divisions, in order to assure storage of equal records among the external memory units of the system.